﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using AutoTLBB.Utilites;
using System.Diagnostics;

namespace AutoTLBB {
    public partial class MainForm : Form {
        private List<Game> m_lstGame = new List<Game>();
        private Game m_currentGame;
        public Game CurrentGame { 
            get { return m_currentGame; }
            private set { m_currentGame = value; } 
        }
        public MainForm() {
            InitializeComponent();

        }

        private void MainForm_Load(object sender, EventArgs e) {
            Refresh();
        }
        
        
        private void RefreshGame() {
            Process[] processesByName = Process.GetProcessesByName("Game");
            List<int> gameItems = new List<int>(processesByName.Length);
            foreach (Process process in processesByName) {
                if (m_lstGame.Find(x => x.ProcessId == process.Id) != null) {
                    continue;
                }
                
                m_lstGame.Add(new Game(process.Id));
                gameItems.Add(process.Id);
            }
            //TODO: should remove all items that has been stopped
        }
    }
}
